package com.lanju.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name="contract")
public class Contract implements Serializable {

	private static final long serialVersionUID = -1600219019264329257L;
	/**
	 * 合同id
	 */
	private String contractId;
	/**
	 * 用户id
	 */
	private String userId;
	/**
	 * 用户姓名
	 */
	private String userName;
	/**
	 * 合同类型
	 */
	private Integer contractType; 
	/**
	 * 签署日期
	 */
	private Date signDate;
	/**
	 * 所在城市
	 */
	private String city;
	/**
	 * 所在区域
	 */
	private String region;
	/**
	 * 房子地址
	 */
	private String houseAddress;
	/**
	 * 合同开始时间
	 */
	private Date contractStartTime;
	/**
	 * 合同结束时间
	 */
	private Date contractEndTime;
	/**
	 * 交付房屋日期
	 */
	private Date deliveryHouseTime;
	/**
	 * 首个管理周年开始日期
	 */
	private Date firstMngStartTime;
	/**
	 * 次个管理周年起
	 */
	private Integer secondMngDays;
	/**
	 * 空置期
	 */
	private Integer vacantPeriod;
	/**
	 * 空置月份
	 */
	private String vacantMonth;
	/**
	 * 租金结算方式
	 */
	private Integer accountTypeMonth;
	/**
	 * 首个结算日期
	 */
	private Date firstAccountTime;
	/**
	 * 服务质量保证金
	 */
	private  Integer serviceSecurity;
	/**
	 * 补充协议
	 */
	private String replenishText;
	/**
	 * 家居费用合计
	 */
	private Integer homeExpenses;
	/**
	 * 甲方出资总费用
	 */
	private Integer partyAExpenses;
	/**
	 * 乙方出资总费用
	 */
	private Integer partyBExpenses;
	/**
	 * 甲方获取合同期内租金收益
	 */
	private Integer partyARentalIncome;
	/**
	 * 乙方获取合同期内租金收益
	 */
	private Integer partyBRentalIncome;
	/**
	 * 甲方向乙方支付租客当月
	 */
	private Integer partyAToBRentalIncome;
	/**
	 * 乙方管理服务费
	 */
	private Integer serviceExpenses;
	/**
	 * 开始计费日期
	 */
	private Date serviceStartTime;
	/**
	 * 结算周期
	 */
	private Integer accountPeriod;
	/**
	 * 创建时间
	 */
	private Date createTime;
	/**
	 *创建人 
	 */
	private String creator;
	/**
	 * 更新时间
	 */
	private Date updateTime;
	/**
	 * 更新人
	 */
	private String updator;
	/**
	 * 	状态:1:已签名，0：待签名，-1：草稿
	 */
	private Integer status;
	
	private  Set<ExpectedFixedIncome> expectedFixedIncomeSet =new HashSet<ExpectedFixedIncome>();
	
	private Set<VacantPeriod> vacantPeriodSet = new HashSet<VacantPeriod>();
	
	@Id
	@Column(name="contractId",unique=true,nullable=false)
	public String getContractId() {
		return contractId;
	}
	public void setContractId(String contractId) {
		this.contractId = contractId;
	}
	@Column(name="userId")
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	@Column(name="signDate")
	public Date getSignDate() {
		return signDate;
	}
	public void setSignDate(Date signDate) {
		this.signDate = signDate;
	}
	@Column(name="houseAddress")
	public String getHouseAddress() {
		return houseAddress;
	}
	public void setHouseAddress(String houseAddress) {
		this.houseAddress = houseAddress;
	}
	@Column(name="contractStartTime")
	public Date getContractStartTime() {
		return contractStartTime;
	}
	public void setContractStartTime(Date contractStartTime) {
		this.contractStartTime = contractStartTime;
	}
	@Column(name="contractEndTime")
	public Date getContractEndTime() {
		return contractEndTime;
	}
	public void setContractEndTime(Date contractEndTime) {
		this.contractEndTime = contractEndTime;
	}
	@Column(name="deliveryHouseTime")
	public Date getDeliveryHouseTime() {
		return deliveryHouseTime;
	}
	public void setDeliveryHouseTime(Date deliveryHouseTime) {
		this.deliveryHouseTime = deliveryHouseTime;
	}
	@Column(name="firstMngStartTime")
	public Date getFirstMngStartTime() {
		return firstMngStartTime;
	}
	public void setFirstMngStartTime(Date firstMngStartTime) {
		this.firstMngStartTime = firstMngStartTime;
	}
	@Column(name="secondMngDays")
	public Integer getSecondMngDays() {
		return secondMngDays;
	}
	public void setSecondMngDays(Integer secondMngDays) {
		this.secondMngDays = secondMngDays;
	}
	@Column(name="vacantPeriod")
	public Integer getVacantPeriod() {
		return vacantPeriod;
	}
	public void setVacantPeriod(Integer vacantPeriod) {
		this.vacantPeriod = vacantPeriod;
	}
	@Column(name="vacantMonth")
	public String getVacantMonth() {
		return vacantMonth;
	}
	public void setVacantMonth(String vacantMonth) {
		this.vacantMonth = vacantMonth;
	}
	@Column(name="firstAccountTime")
	public Date getFirstAccountTime() {
		return firstAccountTime;
	}
	public void setFirstAccountTime(Date firstAccountTime) {
		this.firstAccountTime = firstAccountTime;
	}
	@Column(name="serviceSecurity")
	public Integer getServiceSecurity() {
		return serviceSecurity;
	}
	public void setServiceSecurity(Integer serviceSecurity) {
		this.serviceSecurity = serviceSecurity;
	}
	@Column(name="replenishText")
	public String getReplenishText() {
		return replenishText;
	}
	public void setReplenishText(String replenishText) {
		this.replenishText = replenishText;
	}
	@Column(name="homeExpenses")
	public Integer getHomeExpenses() {
		return homeExpenses;
	}
	public void setHomeExpenses(Integer homeExpenses) {
		this.homeExpenses = homeExpenses;
	}
	@Column(name="partyAExpenses")
	public Integer getPartyAExpenses() {
		return partyAExpenses;
	}
	public void setPartyAExpenses(Integer partyAExpenses) {
		this.partyAExpenses = partyAExpenses;
	}
	@Column(name="partyBExpenses")
	public Integer getPartyBExpenses() {
		return partyBExpenses;
	}
	public void setPartyBExpenses(Integer partyBExpenses) {
		this.partyBExpenses = partyBExpenses;
	}
	@Column(name="partyARentalIncome")
	public Integer getPartyARentalIncome() {
		return partyARentalIncome;
	}
	public void setPartyARentalIncome(Integer partyARentalIncome) {
		this.partyARentalIncome = partyARentalIncome;
	}
	@Column(name="partyBRentalIncome")
	public Integer getPartyBRentalIncome() {
		return partyBRentalIncome;
	}
	public void setPartyBRentalIncome(Integer partyBRentalIncome) {
		this.partyBRentalIncome = partyBRentalIncome;
	}
	@Column(name="partyAToBRentalIncome")
	public Integer getPartyAToBRentalIncome() {
		return partyAToBRentalIncome;
	}
	public void setPartyAToBRentalIncome(Integer partyAToBRentalIncome) {
		this.partyAToBRentalIncome = partyAToBRentalIncome;
	}
	@Column(name="serviceExpenses")
	public Integer getServiceExpenses() {
		return serviceExpenses;
	}
	public void setServiceExpenses(Integer serviceExpenses) {
		this.serviceExpenses = serviceExpenses;
	}
	@Column(name="serviceStartTime")
	public Date getServiceStartTime() {
		return serviceStartTime;
	}
	public void setServiceStartTime(Date serviceStartTime) {
		this.serviceStartTime = serviceStartTime;
	}
	@Column(name="accountPeriod")
	public Integer getAccountPeriod() {
		return accountPeriod;
	}
	public void setAccountPeriod(Integer accountPeriod) {
		this.accountPeriod = accountPeriod;
	}
	@JsonIgnore
	@OneToMany(cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="contract",orphanRemoval = true)
	public Set<ExpectedFixedIncome> getExpectedFixedIncomeSet() {
		return expectedFixedIncomeSet;
	}
	public void setExpectedFixedIncomeSet(
			Set<ExpectedFixedIncome> expectedFixedIncomeSet) {
		this.expectedFixedIncomeSet = expectedFixedIncomeSet;
	}
	
	@JsonIgnore
	@OneToMany(cascade={javax.persistence.CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="contract",orphanRemoval = true)
	public Set<VacantPeriod> getVacantPeriodSet() {
		return vacantPeriodSet;
	}
	public void setVacantPeriodSet(Set<VacantPeriod> vacantPeriodSet) {
		this.vacantPeriodSet = vacantPeriodSet;
	}
	@Column(name="createTime")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name="creator")
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	@Column(name="updateTime")
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	@Column(name="updator")
	public String getUpdator() {
		return updator;
	}
	public void setUpdator(String updator) {
		this.updator = updator;
	}
	@Column(name="userName")
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(name="contractType")
	public Integer getContractType() {
		return contractType;
	}
	public void setContractType(Integer contractType) {
		this.contractType = contractType;
	}
	@Column(name="accountTypeMonth")
	public Integer getAccountTypeMonth() {
		return accountTypeMonth;
	}
	public void setAccountTypeMonth(Integer accountTypeMonth) {
		this.accountTypeMonth = accountTypeMonth;
	}
	@Column(name="city")
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	
	@Column(name="region")
	public String getRegion() {
		return region;
	}
	public void setRegion(String region) {
		this.region = region;
	}
	@Column(name="status")
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	
	
}
